﻿using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class UI_Base : MonoBehaviour 
{
    public bool bQueued = false;
	public UIButton[] arrGuideBtns;//指导用到的按钮，方便查找

    private Transform parentUI;
    private Transform childListUI;

    public Transform ChildListUI
    {
        get { return childListUI; }
        set { childListUI = value; }
    }
    public Transform ParentUI
    {
        get { return parentUI; }
        set { parentUI = value; }
    }


    virtual public bool Init(object arg) {
        return true;
    }

    virtual public void Release()
    {

    }

    virtual public void OnClose()
    {

    }

	/// <summary>
	/// 根据名字获取指导按钮
	/// </summary>
	/// <returns>The guide button.</returns>
	/// <param name="key">Key.</param>
	virtual public UIButton GetGuideButton(string key)
	{
		if (null != arrGuideBtns) 
		{
			foreach(UIButton btn in arrGuideBtns)
			{
				if(btn.name == key)
					return btn;
			}
		}
		return null;
	}
}
